<?php
class Tourism_freight_free_model extends CI_Model
{
    private $table   = 'tourism_freight_free';
    
     /**
     * 插入数据
     * @param unknown $param
     */
    public function insert($param){
    	
       return $this->db->insert($this->table,$param);
    }
    
    /**
     * 删除
     * @param unknown $tid
     */
    public function deleteByTid($tid){
         
        $this->db->where('tid',$tid);
        return $this->db->delete($this->table);
    }
    
     /**
     * 获取指定条件包邮
     * @param unknown $id
     */
    public function getFreightFree($tid)
    {
        $this->db->where('tid',$tid);
        return $this->db->get($this->table);
    }
    
     /**
     * 更新和删除
     * @param unknown $template_id
     * @param unknown $free_params
     */
    public function updateByTid($template_id,$free_params){
    	
        $this->db->where('tid', $template_id);
        $this->db->delete($this->table);
        
        return $this->db->insert($this->table,$free_params);
    }
}